# Copyright 2010 Mikko Rantanen
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from directory import Directory
import fsentry

class Vault(Directory):
    """
        Vault root object.

        This type has quite few special cases as it's the only
        type that does NOT have a parent. In practice this means
        it has to override all Directory/FSEntry methods that
        would refer to self.parent.
    """

    def __init__(self, conn):
        self.conn = conn
        Directory.__init__(self, '', conn)

    def get_conn(self):
        return self.conn
    
    def get_name(self):
        return ''

    def get_urlname(self):
        return ''

    def get_urlpath(self):
        return ''

    def get_fspath(self):
        return '/'

    def get_child(self, path):
        if path == '/':
            return self
        else:
            return Directory.get_child(self, path) 



    
